
************************************************************************************************************
**#							TABLE 2 - EMPLOYEE RESPONSE
************************************************************************************************************

capture cd "/Users/joshw/CEO Pay Ratio/Analysis/"
use "Data/Temp/dataset_main.dta", clear

*********************
*Change in Pay Rating
*********************
est clear
eststo: xi: reghdfe gd_pay_diff_365 pr_quint_5 pr_quint_1 gd_pay_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr==1, absorb(ffi49)
eststo: xi: reghdfe gd_pay_diff_365 pr_quint_5 pr_quint_1 gd_pay_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr!=1, absorb(indyr)
eststo: xi: reghdfe gd_pay_diff_365 ln_upr ln_epr gd_pay_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr==1, absorb(ffi49)
eststo: xi: reghdfe gd_pay_diff_365 ln_upr ln_epr gd_pay_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr!=1, absorb(indyr)
esttab using "Output/Tables/RF/T2_emp_payrating.csv", b(3) ar2 varwidth(25) title("Pay Rating") order(pr_quint_5 pr_quint_1 ln_upr ln_epr gd_pay_pre_365 size mtb roa io cash lev salesg_w tsr union rd) star(* 0.10 ** 0.05  *** 0.01 ) drop(_cons) replace

***********************
*Change in Productivity
***********************
est clear
eststo: xi: reghdfe ln_prod_diff pr_quint_5 pr_quint_1 ln_prod_pre_365 size mtb roa io cash lev salesg_w tsr union rd fixed_assets if sample_yr==1 ,absorb(ffi49)
eststo: xi: reghdfe ln_prod_diff pr_quint_5 pr_quint_1 ln_prod_pre_365 size mtb roa io cash lev salesg_w tsr union rd fixed_assets if sample_yr!=1 ,absorb(indyr)
eststo: xi: reghdfe ln_prod_diff ln_upr ln_epr ln_prod_pre_365 size mtb roa io cash lev salesg_w tsr union rd fixed_assets if sample_yr==1 ,absorb(ffi49)
eststo: xi: reghdfe ln_prod_diff ln_upr ln_epr ln_prod_pre_365 size mtb roa io cash lev salesg_w tsr union rd fixed_assets if sample_yr!=1 ,absorb(indyr)
esttab using "Output/Tables/RF/T2_emp_prod.csv", b(3) ar2 varwidth(25) title("Productivity") order(pr_quint_5 pr_quint_1 ln_upr ln_epr ln_prod_pre_365 size mtb roa io cash lev salesg_w tsr union rd fixed_assets) star(* 0.10 ** 0.05  *** 0.01 ) drop(_cons) replace

*************************
*Change in CEO disapproval
************************* 
est clear
eststo: xi: reghdfe gd_ceodis_diff_365 pr_quint_5 pr_quint_1 gd_ceodis_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr==1 ,absorb(ffi49)
eststo: xi: reghdfe gd_ceodis_diff_365 pr_quint_5 pr_quint_1 gd_ceodis_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr!=1 ,absorb(indyr)
eststo: xi: reghdfe gd_ceodis_diff_365 ln_upr ln_epr gd_ceodis_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr==1 ,absorb(ffi49)
eststo: xi: reghdfe gd_ceodis_diff_365 ln_upr ln_epr gd_ceodis_pre_365 size mtb roa io cash lev salesg_w tsr union rd if sample_yr!=1 ,absorb(indyr)
esttab using "Output/Tables/RF/T2_emp_ceodis.csv", b(3) ar2 varwidth(25) title("CEO Disapproval") order(pr_quint_5 pr_quint_1 ln_upr ln_epr gd_ceodis_pre_365 size mtb roa io cash lev salesg_w tsr union rd) star(* 0.10 ** 0.05  *** 0.01 ) drop(_cons) replace

*******************************************
*Yearly correlation (untabulated, Sec. 3.2)
*******************************************
est clear
pwcorr gd_pay_post_365 gd_pay_pre_365
pwcorr gd_ceodis_post_365 gd_ceodis_pre_365

********************************************************
*Averaages for economic magnitude (untabulated, Sec 4.2)
********************************************************
est clear
*Changes in employee variables year 1
tabstat gd_pay_diff_365 ln_prod_diff gd_ceodis_diff_365 if(sample_yr==1), stat(mean sd) col(stat)long
*Changes in employee variables year 1 by quintile
tabstat gd_pay_diff_365 ln_prod_diff gd_ceodis_diff_365 if(sample_yr==1), by(pr_quint) stat(mean sd) col(stat)long
*Changes in employee variables year 1 for quintiles 2 to 4
tabstat gd_pay_diff_365 ln_prod_diff gd_ceodis_diff_365 if(sample_yr==1 & pr_quint>1 & pr_quint<5), stat(mean sd) col(stat)long
